<!DOCTYPE html>
<input>
<script>
    const input = document.querySelector('input');
    const isValid = input.validity.valid;
</script>
